import request from '@/config/axios'

export interface UserVO {
  id: number
  phone: string
  nickName: string
  unionId: string
  publicOpenid: string
  programOpenid: string
  subscribeStatus: boolean
  avatar: string
}

// 查询客户信息分页
export const getUserPage = async (params) => {
  return await request.get({ url: `/gd/user/page`, params })
}

// 查询客户信息详情
export const getUser = async (id: number) => {
  return await request.get({ url: `/gd/user/get?id=` + id })
}

// 新增客户信息
export const createUser = async (data: UserVO) => {
  return await request.post({ url: `/gd/user/create`, data })
}

// 修改客户信息
export const updateUser = async (data: UserVO) => {
  return await request.put({ url: `/gd/user/update`, data })
}

// 删除客户信息
export const deleteUser = async (id: number) => {
  return await request.delete({ url: `/gd/user/delete?id=` + id })
}

// 导出客户信息 Excel
export const exportUser = async (params) => {
  return await request.download({ url: `/gd/user/export-excel`, params })
}